<div class="content-section introduction">
    <div>
        <span class="feature-title">Button</span>
        <span>Button is an extension to standard input element with icons and theming.</span>
    </div>
</div>

<div class="content-section implementation">
    <button pButton type="button" (click)="count()" label="Click"></button>

    <button pButton type="button" (click)="count()" icon="fa-check" label="Click"></button>
    
    <button pButton type="button" (click)="count()" icon="fa-check" iconPos="right" label="Click"></button>
    
    <button pButton type="button" (click)="count()" icon="fa-close"></button>
    
    <button pButton type="button" (click)="count()" icon="fa-check" [disabled]="true" label="Disabled"></button>

    <h3>Severity Buttons</h3>

    <button pButton type="button" (click)="count()" label="Primary"></button>

    <button pButton type="button" (click)="count()" label="Secondary" class="ui-button-secondary"></button>

    <button pButton type="button" (click)="count()" label="Success" class="ui-button-success"></button>

    <button pButton type="button" (click)="count()" label="Info"  class="ui-button-info"></button>

    <button pButton type="button" (click)="count()" label="Warning"  class="ui-button-warning"></button>

    <button pButton type="button" (click)="count()" label="Danger"  class="ui-button-danger"></button>

    <br /><br />
    Number of clicks: {{clicks}}
</div>

<div class="content-section documentation">
    <p-tabView effect="fade">
        <p-tabPanel header="Documentation">
                    <h3>Import</h3>
<pre>
<code class="language-typescript" pCode ngNonBindable>
import &#123;ButtonModule&#125; from 'primeng/primeng';
</code>
</pre>

            <h3>Getting Started</h3>
            <p>Button is applied to a button element with pButton directive. Text of the button is defined using label property.</p>
            
<pre>
<code class="language-markup" pCode ngNonBindable>
&lt;button pButton type="button" label="Click"&gt;&lt;/button&gt;
</code>
</pre>

            <h3>Events</h3>
            <p>Events are defined using standard notation.</p>
            
<pre>
<code class="language-markup" pCode ngNonBindable>
&lt;button pButton type="button" (click)="onclick()" label="Click"&gt;&lt;/button&gt;
</code>
</pre>

<pre>
<code class="language-typescript" pCode ngNonBindable>
export class Model &#123;

    onclick() &#123;
        //execute action
    &#125;

&#125;
</code>
</pre>

            <h3>Icons</h3>
            <p>Icon on a button is specified with icon attribute and position is customized using iconPos attribute. Default
            icon position is left. To display only an icon, leave label as undefined.</p>
<pre>
<code class="language-markup" pCode ngNonBindable>
&lt;button pButton type="button" icon="fa-check" iconPos="left"&gt;&lt;/button&gt;
</code>
</pre>

            <h3>Severity</h3>
            <p>Different color options are available to define severity levels.</p>
            
            <ul>
                <li>.ui-button-secondary</li>
                <li>.ui-button-success</li>
                <li>.ui-button-info</li>
                <li>.ui-button-warning</li>
                <li>.ui-button-danger</li>
            </ul>
<pre>
<code class="language-markup" pCode ngNonBindable>
&lt;button pButton type="button" class="ui-button-info"&gt;&lt;/button&gt;
</code>
</pre>

            <h3>Properties</h3>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Type</th>
                            <th>Default</th>
                            <th>Description</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>label</td>
                            <td>string</td>
                            <td>null</td>
                            <td>Text of the button.</td>
                        </tr>
                        <tr>
                            <td>icon</td>
                            <td>string</td>
                            <td>null</td>
                            <td>Name of the icon.</td>
                        </tr>
                        <tr>
                            <td>iconPos</td>
                            <td>string</td>
                            <td>left</td>
                            <td>Position of the icon, valid values are "left" and "right".</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h3>Styling</h3>
            <p>Following is the list of structural style classes, for theming classes visit <a href="#" [routerLink]="['/theming']">theming page</a>.</p>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Element</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>ui-button</td>
                            <td>Button element</td>
                        </tr>
                        <tr>
                            <td>ui-button-icon</td>
                            <td>Icon element</td>
                        </tr>
                        <tr>
                            <td>ui-button-text</td>
                            <td>Label element of the button</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h3>Dependencies</h3>
            <p>None.</p>
        </p-tabPanel>
        <p-tabPanel header="Source">
            <a href="https://github.com/primefaces/primeng/tree/master/src/app/showcase/components/button" class="btn-viewsource" target="_blank">
                <i class="fa fa-github"></i>
                <span>View on GitHub</span>
            </a>
<pre>
<code class="language-markup" pCode ngNonBindable>
&lt;button pButton type="button" (click)="count()" label="Click"&gt;&lt;/button&gt;

&lt;button pButton type="button" (click)="count()" icon="fa-check" label="Click"&gt;&lt;/button&gt;

&lt;button pButton type="button" (click)="count()" icon="fa-check" iconPos="right" label="Click"&gt;&lt;/button&gt;

&lt;button pButton type="button" (click)="count()" icon="fa-check"&gt;&lt;/button&gt;

&lt;button pButton type="button" (click)="count()" icon="fa-check" [disabled]="true" label="Disabled"&gt;&lt;/button&gt;

Number of clicks: {{clicks}}
</code>
</pre>
<pre>
<code class="language-typescript" pCode ngNonBindable>
export class ButtonDemo &#123;

    clicks: number = 0;

    count() &#123;
        this.clicks++;
    &#125;
&#125;
</code>
</pre>
        </ p-tabPanel>
     </p-tabView >
</div>